////////////////////////////////////////////////////////////////////////////////////////////////////
/// Copyright (c) 2009 - 2010 RacoonStudios
///
/// Permission is hereby granted, free of charge, to any person obtaining a copy of this
/// software and associated documentation files (the "Software"), to deal in the Software
/// without restriction, including without limitation the rights to use, copy, modify, merge,
/// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
/// to whom the Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice shall be included in all copies or
/// substantial portions of the Software.
///
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
/// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
/// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
/// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
/// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
/// DEALINGS IN THE SOFTWARE.
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once
#ifndef keyvaluepair_h__
#define keyvaluepair_h__

#include "core\types.h"

namespace Helper
{

	/// @class KeyValuePair
	/// @todo	Add documentation!

	template<class K, class V>
	class KeyValuePair
	{
		public:

			KeyValuePair();

			KeyValuePair(const K & key);

			KeyValuePair(const K & key, const V & value);

			KeyValuePair(const KeyValuePair<K,V> & rhs);

			~KeyValuePair();



			void operator = (const KeyValuePair<K,V> & rhs);

			bool operator == (const KeyValuePair<K,V> & rhs) const;

			bool operator != (const KeyValuePair<K,V> & rhs) const;

			bool operator <  (const KeyValuePair<K,V> & rhs) const;

			bool operator >  (const KeyValuePair<K,V> & rhs) const;

			bool operator <= (const KeyValuePair<K,V> & rhs) const;

			bool operator >= (const KeyValuePair<K,V> & rhs) const;



			const K & Key() const;

			const V & Value() const;

			V & Value();


		protected:

			K m_key;

			V m_value;

		private:

	};





	///
	template<class K, class V>
	KeyValuePair<K,V>::KeyValuePair()
	{

	}


	///
	template<class K, class V>
	KeyValuePair<K,V>::KeyValuePair(const K & key):
	m_key(key)
	{

	}


	///
	template<class K, class V>
	KeyValuePair<K,V>::KeyValuePair(const K & key, const V & value):
	m_key(key),
		m_value(value)
	{

	}


	///
	template<class K, class V>
	KeyValuePair<K,V>::KeyValuePair(const KeyValuePair<K,V> & rhs):
	m_key(rhs.m_key),
		m_value(rhs.m_value)
	{

	}


	///
	template<class K, class V>
	KeyValuePair<K,V>::~KeyValuePair()
	{

	}





	///
	template<class K, class V>
	void KeyValuePair<K,V>::operator = (const KeyValuePair<K,V> & rhs)
	{
		this->m_key = rhs.m_key;

		this->m_value = rhs.m_value;
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator == (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key == rhs.m_key);
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator != (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key != rhs.m_key);
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator <  (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key < rhs.m_key);
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator >  (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key > rhs.m_key);
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator <= (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key <= rhs.m_key);
	}


	///
	template<class K, class V>
	bool KeyValuePair<K,V>::operator >= (const KeyValuePair<K,V> & rhs) const 
	{
		return (this->m_key >= rhs.m_key);
	}





	///
	template<class K, class V>
	const K & KeyValuePair<K,V>::Key() const 
	{
		return this->m_key;
	}


	///
	template<class K, class V>
	const V & KeyValuePair<K,V>::Value() const 
	{
		return this->m_value;
	}


	///
	template<class K, class V>
	V & KeyValuePair<K,V>::Value()
	{
		return this->m_value;
	}

}

#endif // keyvaluepair_h__